package com.supercell.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by WUJO2 on 7/15/2016.
 */
@Entity
@Table
public class Person extends GenericEntity {
    public static final String NAME = "name";
    public static final String BIRTHDAY = "birthday";
    public static final String TELEPHONE = "telephone";
    public static final String DEPARTMENT_ID = "departmentID";
    public static final String SALARY = "salary";

    public static final String CLIENT_SIDE_DUMMY_DEPARTMENT_ID = "did";
    public static final String CLIENT_SIDE_DUMMY_NAME = "pname";
    public static final String CLIENT_SIDE_DUMMY_TELEPHONE = "tel";

    @ManyToOne
    private Department department;

    @Column(nullable = false)
    private String name;

    @Column
    private Date birthday;

    @Column
    private String telephone;

    @Column
    private Integer salary;

    /**
     * Redundant attribute for convenience of processing incoming Person record.
     */
    @Column(nullable = false)
    private Integer departmentID;

    public Person() {
    }

    public Person(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public Integer getDepartmentID() {
        return departmentID;
    }

    public void setDepartmentID(Integer departmentID) {
        this.departmentID = departmentID;
    }

    public Integer getSalary() {
        return salary;
    }

    public void setSalary(Integer salary) {
        this.salary = salary;
    }
}
